package com.wty.design.structural.decorator.v2;

/**
 * @Author wangtengyu
 * @Create 2018-09-19-10:17
 */
public class Test {
    public static void main(String[] args) {

        AbstractBatterCake batterCake=new BatterCake();
        System.out.println(batterCake.getDescription()+"销售价格"+batterCake.cost());

        //煎饼加蛋
        AbstractBatterCake batterCakeWithEgg=new EggDecorator(batterCake);
        System.out.println(batterCakeWithEgg.getDescription()+"销售价格"+batterCakeWithEgg.cost());

        //煎饼加两个蛋
        AbstractBatterCake batterCakeWithTwoEgg=new EggDecorator(batterCakeWithEgg);
        System.out.println(batterCakeWithTwoEgg.getDescription()+"销售价格"+batterCakeWithTwoEgg.cost());

        //煎饼加单加肠
        AbstractBatterCake batterCakeWithEggAndSanusage=new SausageDecorator(batterCakeWithEgg);
        System.out.println(batterCakeWithEggAndSanusage.getDescription()+"销售价格"+batterCakeWithEggAndSanusage.cost());


    }
}
